package com.m3958.firstgwt.client.place;

import com.m3958.firstgwt.client.MyPlace;
import com.m3958.firstgwt.client.types.ViewNameEnum;

public class ArticleListPlace extends MyPlace{
	
	private String siteId;

	private String sectionId;
	
	public ArticleListPlace(String siteId,String sectionId){
		this.siteId = siteId;
		this.sectionId = sectionId;
	}
	
	public ArticleListPlace(String siteAndSection){
		String[] ss = siteAndSection.split(",");
		this.siteId = ss[0];
		if(ss.length > 1)this.sectionId = ss[1];
	}
	
	@Override
	public String getToken() {
		return ViewNameEnum.ARTICLE.toString().toLowerCase() + "/" + siteId + "," + sectionId;
	}

	public String getSectionId() {
		return sectionId;
	}

	public void setSectionId(String sectionId) {
		this.sectionId = sectionId;
	}

	public void setSiteId(String siteId) {
		this.siteId = siteId;
	}

	public String getSiteId() {
		return siteId;
	}

}
